Skip to content

feat(tui): add /disconnect command for providers#29237

Open
iiroak wants to merge 3 commits into
anomalyco:devfrom
iiroak:feat/disconnect-provider
Open

feat(tui): add /disconnect command for providers#29237
iiroak wants to merge 3 commits into
anomalyco:devfrom
iiroak:feat/disconnect-provider

Conversation

@iiroak
Copy link
Copy Markdown

@iiroak iiroak commented May 25, 2026

Issue for this PR

Closes #23923

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds a /disconnect slash command to the TUI that lets users remove connected providers without editing config files manually.

The command opens a DialogProviderDisconnect dialog listing all connected providers. For each provider it:

  • Calls sdk.client.auth.remove to delete stored credentials
  • For non-API sources (config/env), updates disabled_providers in the config so the provider doesn't reconnect on next bootstrap
  • Disposes the instance and re-runs sync.bootstrap to refresh state
  • Console-managed providers are shown as disabled since they can't be disconnected from the CLI

I verified the behavior works by testing API key providers and config-based providers locally. Console-managed providers correctly show as disabled with a tooltip explaining they're managed by OpenCode Console.

How did you verify your code works?

  • Ran bun test from packages/opencode — all tests pass
  • Manually tested /disconnect command in TUI
  • Verified API key providers are removed and sync refreshes
  • Verified config providers get added to disabled_providers
  • Verified console-managed providers appear disabled

Screenshots / recordings

{D652E20A-C6A1-4028-B8B0-7EBE0B2FC4A1} {756374CB-47B4-4D0F-89F8-4AEEC5136250}

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

iiroak added 3 commits May 25, 2026 11:22
- Add provider.disconnect command to app.tsx
- Create DialogProviderDisconnect component
- Support API key, config, env, and console-managed providers
- Add disabled_providers config update for non-API sources
- Include tests for command registration and dialog behavior
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]:allow /disconnect from cli

1 participant